/**
 * 接口模板
 */
import request from '@/utils/request.js'

/**
 * 查询分页
 */
export const getList = (current, limit, search) => {
  return request({
    url: '',
    method: 'GET',
    params: {
      ...search,
      current,
      limit
    },
  })
}

/**
 * 删除单个(很少用)
 */
// export const remove = (id) => {
//   return request({
//     url: `/${id}`,
//     method: 'DELETE',
//   })
// }

// 删除多个 （常用）
export const remove = (ids) => {
  return request({
    url: "",
    method: 'DELETE',
    params: {
      ids
    }
  })
}

/**
 * 修改
 */
export const update = (row) => {
  return request({
    url: '',
    method: 'PUT',
    data: row,
  })
}

/**
* 获取详情数据
*/
export const getNotice = (id) => {
  return request({
    url: `/${id}`,
    method: 'GET',
  })
}

/**
* 添加数据
*/
export const add = (row) => {
  return request({
    url: '',
    method: 'POST',
    data: row,
  })
}